package cn.edu.neusoft.demo.hospital2.Dao;

import cn.edu.neusoft.demo.hospital2.pojo.MedicalRecord;
import cn.edu.neusoft.demo.hospital2.pojo.Messageboard;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MedicalRecordDao extends BaseMapper<MedicalRecord> {
    List<MedicalRecord> getAllRecords();
    MedicalRecord getRecordById(Integer recordId);
    int insert(MedicalRecord medicalRecord);
    int updateById(MedicalRecord medicalRecord);
    int deleteById(Integer recordId);

    @Select("SELECT * FROM medical_record WHERE appointment_id = #{appointmentId}")
    MedicalRecord findByAppointmentId(@Param("appointmentId") Integer appointmentId);
}
